/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ecommerce.controller.json;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 *
 * @author Yoonan
 */
@Controller
public class VariableControll {

//    @RequestMapping(value = "/text/{id}")
//    @ResponseBody
//    public String method7(@PathVariable("id") int id) {
//        return "method7 with id=" + id;
//    }
    
    //http://localhost:8084/Pattern/text2/10/Lisa
    @RequestMapping(value = "/text2/{id:[\\d]+}/{name}")
    @ResponseBody 
    public String method8(@PathVariable("id") long id, @PathVariable("name") String name) {
        return "method8 with id= " + id + " and name=" + name;
    }
}
